<template>
    <div class="brand-index" id="brand-index">
        <breadcrumb></breadcrumb>

        <el-tabs v-if="showTabs" class="brand-tabs" v-model="activeName" @tab-click="handleChangeTab">
            <el-tab-pane label="审核人员" name="brand-aduits"></el-tab-pane>
            <el-tab-pane label="销售人员" name="brand-sales"></el-tab-pane>
            <el-tab-pane label="资料" name="brand-data"></el-tab-pane>
        </el-tabs>

        <div class="content">
            <router-view></router-view>
        </div>
    </div>
</template>

<script>
import '@/styles/brand/index.scss'
import Breadcrumb from './components/breadcrumb'
import { mapGetters, mapActions } from 'vuex'
export default {
    components: {
        Breadcrumb
    },

    data: () => ({
        activeName: 'brand'
    }),

    created() {
    },

    mounted() {
        this.activeName = this.$route.name
    },

    computed: {
        showTabs() {
            return ['brand-aduits', 'brand-sales', 'brand-data'].indexOf(this.$route.name) !== -1
        }
    },

    methods: {
        // tab切换
        handleChangeTab(tab, event) {
            this.activeName = tab.name
            this.$router.push({ name: this.activeName })
        }
    }
}
</script>
